export default function useToastMsg() {

    const showLoading = (title='加载中') => uni.showLoading({ title: title, mask: true })

    const hideLoading = () => uni.hideLoading()
    
    const showToast = (title: string) => uni.showToast({ title: title, duration: 2000,icon: 'none', })

    const successMsg = (title: string) => uni.showToast({ title: title, duration: 2000, icon: 'success' })

    const errorMsg = (title: string) => uni.showToast({ title: title, duration: 2000, icon: 'error' })

    const closeMsg = () => uni.hideToast()

    return { showToast, successMsg, errorMsg, closeMsg, showLoading, hideLoading }
}